package com.jpa.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.jpa.dao.RoleDao;
import com.jpa.dao.UserDao;
import com.jpa.pojo.Role; 
import com.jpa.pojo.User;
import com.jpa.service.UsersService;

@Service
public class UsersServiceImpl implements UsersService {

	@Autowired
	UserDao userDao;

	@Autowired
	RoleDao authDao;

	@Override
	public User findByUsername(String username) {
		return userDao.findByUsername(username);
	}

	@Override
	public List<User> findAll() {
		return (List<User>) userDao.findAll();
	}

	@Override
	public List<Role> findRoles(String name) {
		return authDao.findRoles(name);
	}

	 

}
